package com.navicoa.e_libreria.utiles;

import com.navicoa.e_libreria.presentacion.VistaMain;

public class Reloj implements Runnable{

	private VistaMain vM;
	private Thread h1;
	
	public Reloj(VistaMain vM){
		this.vM = vM;
		h1 = new Thread(this);
		h1.start();
	}
	
	public void run() {
		Thread ct = Thread.currentThread();
		
		while(ct == h1){
			
			vM.setHora();
			
			try{
				Thread.sleep(500);
			}catch(InterruptedException e){
				
			}
		}
	}
	
}